extends ../inc/layout
block style
	link(rel='stylesheet' href='/assets/vendor/markdown-github.css')
block main
	#main.container
		#main-inner
			#edit_error
				if edit_error
					.alert.alert-danger(role='alert')
						span #{edit_error}

			#writeBlog.row
				form.form-horizontal(role='form', action='/soft/#{id ? id + "/update" : "create"}', method='post')
					.form-group
						label(for='title') 标题
						input#title.form-control(type='text', name='title', value='#{title || ""}')
					.form-group
						label(for='abstract') 摘要
						textarea#abstract.form-control(name='abstract', rows=3) !{abstract || ''}
					.form-group
						label(for='content') 正文
						textarea#content.form-control(name='content', rows=18) !{content || ''}
					.form-group
						label(for='tags') 标签
						input#tags.form-control(type='text', name='tags', placeholder='多个标签用逗号隔开', value='#{tags || ""}')
					button.btn.btn-primary(type='submit', data-loading-text='正在发表...') &nbsp;发&nbsp;&nbsp;表&nbsp;
block script
	script(src='/assets/bootstrap-3.2.0/js/bootstrap.min.js')
	script(src='/assets/markdown/markdown.js')
	script(src='/assets/markdown/markdown-editor.js')
	script.
		$(function() {
			$('#content').markdown();
		});
		window.onbeforeunload = onbeforeunload_handler;             
		function onbeforeunload_handler(){     
			var warning="确认放弃此文章确定要离开此页吗?";             
			return warning;     
		} 